userIsAllowed(object, action)
Available in Controllers, Domains, Taglibs and Services
This method returns true if the current user is permitted to perform the specified action on the object.
The implementation of this method is provided by the security provider you have installed.
If a provide does not implement ACLs this will return true.
Usage
1 2 3 4 5 6 7 8 | class PurchaseService { void updatePurchase(Purchase p) { if (userIsAllowed(p, 'edit' )) { … } } … } |
Arguments
Name | Description |
---|---|
object | The object on which the user is about to perform an action |
action | The action you wish to perform |